package NewCoder;

public class BM93 {
    public int maxArea (int[] height) {
        // write code here
        int i=0;
        int j=height.length-1;
        int max=0;
        int contains=0;
        while(i<j){
            contains=(j-i)*Math.min(height[i],height[j]);
            max=Math.max(contains,max);
            if(height[i]<height[j]){
                i++;
            }else if(height[i]>height[j]){
                j--;
            }else{
                i++;
                j--;
            }
        }
        return max;
    }
}
